const { injectBabelPlugin } =require('react-app-rewired');
const rewireLess = require('react-app-rewire-less');

module.exports=function override(config,env){
    config=injectBabelPlugin(
        [
            'import',
            {
                libraryName: 'antd',
                libraryDirectory: 'es',
                style: true
            },
            "antd"
        ],config);
    config=injectBabelPlugin(
        [
            'import',
            {
                libraryName: 'ant-design-pro',
                libraryDirectory: 'lib',
                style: true,
                camel2DashComponentName: false
            },
            "ant-design-pro"
        ],config);
    config = rewireLess.withLoaderOptions({
        modifyVars: {
            // "@primary-color":"#001529",
            // "@link-color": "#001529",
            // 'border-radius-base': '2px',
        },
        javascriptEnabled: true,
    })(config, env);
    return config;
}